/**
 * 时间 ： 2014-6-9 下午1:55:16
 * 作者 ： HaiTao
 * 描述 ： 当前类的描述信息
 **/
package com.laitaoo.views.storage
{
	import com.laitaoo.event.StorageEvent;
	import com.laitaoo.views.BaseMediator;
	
	[RouteEvents(events="storageList,addStorage")]
	[Component]
	public class StorageMediator extends BaseMediator
	{
		
		public function StorageMediator()
		{
			super();
		}
		
		/**
		 * 获取所有仓库获取
		 * */
		public function getStorageList():void{
			
			var storageEvent:StorageEvent = new StorageEvent(StorageEvent.STORAGELIST);
			eventBus.dispatchEvent(storageEvent);
		}
		/**
		 * 添加货物
		 * */
		public function addStorage(price:String,count:String,totalPrice:String,productId:String,storageId:String):void{
			
			var storageEvent:StorageEvent = new StorageEvent(StorageEvent.addStorage);
			storageEvent.price = price;
			storageEvent.count = count;
			storageEvent.totalPrice = totalPrice;
			storageEvent.productId = productId;
			storageEvent.storageId = storageId;
			eventBus.dispatchEvent(storageEvent);
		}
		[EventHandler]
		public function addStorageResultHandler(event:StorageEvent):void{
			getStorageList();
		}
		
		
		
		
		
	}
}